package com.neuedu.android.server.controller;

import com.neuedu.android.server.entity.Concat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;

/**
 * 项目：      android-server
 * 类名:       ConcatController
 * 创建时间：  2024/5/30 09：08
 * 描述 :
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      http://127.0.0.1:8080/concat/list
 */
@RestController
@RequestMapping("/concat")
public class ConcatController {

    String types[] = new String[]{"成人","学生","老人","军人"};


    String names[] = new String[]{"邬昀华",
            "杨音好",
            "万靓侃",
            "章咪海",
            "包菊会",
            "柯宗福",
            "叶深宝",
            "萧嵘纳",
            "薄朴军",
            "裴俭杨",
            "申京姿",
            "裴曦尤",
            "郎建盟",
            "钱洁惟",
            "蒙向锬",
            "祝沛闯",
            "裴影霏",
            "鲍雪玥",
            "贺骊昭",
            "尹笑漫",
            "黎海荷",
            "仰岭冰",
            "晏剑伊",
            "吴河溢",
            "薛艺沁",
            "虞拓屹",
            "奚涓琴",
            "怀姗琦",
            "丁宝焰",
            "庞江歆",
            "顾耘畏"};




    @RequestMapping("/index")
    String index(){
        return "success";
    }
    @RequestMapping("/list")
    List<Concat> list(){


        //模拟从数据库查询数据
        List list = new ArrayList();

        Random rand = new Random();
        for (int i = 0; i < 10; i++) {

            list.add(new Concat(i,names[i],UUID.randomUUID().toString(),types[rand.nextInt(types.length-1)]));
        }


        return list;
    }


}
